﻿@model FantasyBlog.Models.RegisterModel
@{
    Layout="";
 }
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>@ProviderAFactory.SiteMetaData["site-title"] &rsaquo; 登录</title>
<link rel='stylesheet' id='login-css'  href="@Url.Content("~/Content/themes/base/Login.css")" type='text/css' media='all' />
<link rel='stylesheet' id='colors-fresh-css'  href="@Url.Content("~/Content/themes/base/colors-fresh.css")" type='text/css' media='all' />
    <script type='text/javascript' src="@Url.Content("~/Scripts/jquery-1.5.1.js")"></script>
<style type="text/css" media="screen">
    * { font: 12px Segoe UI,Tahoma,Arial,Verdana,simsun,sans-serif,"Microsoft YaHei"; }
</style>
<script language="javascript" type="text/javascript">
    function CheckPassword() {
        p1 = document.getElementById("Password");
        p2 = document.getElementById("Comfirm");
        if (p2.value == "")
            return true;
        if (p1.value != p2.value) {
            $("#password").html("<p ><label>两次密码不匹配<br /></label></p>");
            $("#password").show("fast");
            p1.style.borderColor = "#FFA0A0";
            p2.style.borderColor = "#FFA0A0";
            return false;
        }
        else {
            $("#password").hide("fast");
            p1.style.borderColor = "";
            p2.style.borderColor = "";
            return true;
        }
    }
    function CheckModel() {
        result = true;
        if ($("#Username").val().length <6 ){
            $("#UsernameError").show("fast");
            result = false;
        }
        else {
            $("#UsernameError").hide("fast");
        }
        if ($("#Username").val().length < 6) {
            $("#UsernameError").show("fast");
            result = false;
        }
        else {
            $("#UsernameError").hide("fast");
        }
        if ($("#Displayname").val().length < 6) {
            $("#DisplaynameError").show("fast");
            result = false;
        }
        else {
            $("#DisplaynameError").hide("fast");
        }
        reg = /^\w{3,}@@\w+(\.\w+)+$/
        if (!reg.test($("#Email").val())) {
            $("#EmailError").show("fast");
            $("#EmailError").html("<p ><label>邮箱格式不正确<br /></label></p>");
        }
        if (CheckPassword() == true) {
            if ($("#Password").val().length < 6) {
                result = false;
                $("#password").show("fast");
                $("#password").html("<p ><label>密码必须大于6个字符<br /></label></p>");
            }
        }
        else
            result = false;
        return result;
    }
</script>
<meta name='robots' content='noindex,nofollow' />
</head>
<body class="login">
<div id="login"><h1><a href="@Url.Content("~/Post/")" title="Fantasy Blog">@ProviderAFactory.SiteMetaData["site-title"]</a></h1>
<form name="registerform" id="registerform" action="/Account/Register" method="post" onsubmit = "return CheckModel()">
    <div class="error-message" id="UsernameError"><p ><label>用户名必须大于6个字符<br /></label></p></div>
    <p>
        <label>用户名*<br />
        <input type="text" name="UserName" id="Username" class ="input" value="" size="20" tabindex="10" />
        </label>
    </p>
    <div class="error-message" id="DisplaynameError"><p ><label>昵称必须大于6个字符<br /></label></p></div>
    <p>
        <label>昵称*<br />
        <input type="text" name="DisplayName" id="Displayname" class ="input" value="" size="20" tabindex="20" />
        </label>
    </p>
    <div class="error-message" id="EmailError"><p ><label>邮箱格式不正确<br /></label></p></div>
    <p>
        <label>邮箱*<br />
        <input type="text" name="Email" id="Email" class ="input" value="" size="20" tabindex="30" />
        </label>
    </p>
    <div class="error-message" id="password"><p ><label>密码不匹配<br /></label></p></div>
    <p>
        <label>密码*<br />
        <input type="password" name="Password" id="Password" class ="input" value="" size="20" tabindex="40"   onchange="CheckPassword()" />
        </label>
    </p>
    <p>
        <label>重复密码*<br />
        <input type="password" name="Comfirm" id="Comfirm" class ="input" value="" size="20" tabindex="50"  onchange="CheckPassword()" />
        </label>
    </p>

   
    <p class="submit">
        <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="注册" tabindex="100"/>
    </p>

</form>

<p id="backtoblog"><a href=@Url.Content("~/Post/") title="不知道自己在哪？">&larr; 回到 @ProviderAFactory.SiteMetaData["site-title"]</a></p>
</div>



</body>
</html>

